﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;

namespace OrderService
{
    
    [ServiceContract]
    public interface IOrderService
    {
        [OperationContract]
        Order[] getOrders();

        [OperationContract]
        int generateQuote(string name, string email, String[] parts, int cost);

        [OperationContract]
        void setStatus(int id, String status);

        [OperationContract]
        Order getOrderByID(int id);

    }

    [DataContract]
    public class Order {

        [DataMember]
        public int id { get; set; }

        [DataMember]
        public String name { get; set; }

        [DataMember]
        public String email { get; set; }

        [DataMember]
        public String status{ get; set; }

        [DataMember]
        public String[] parts { get; set; }

        [DataMember]
        public int total_cost { get; set; }

        public Order(int id, String name, String email, String status, String[] parts, int total_cost) {

            this.id = id;
            this.name = name;
            this.email = email;
            this.status = status;
            this.parts = parts;
            this.total_cost = total_cost;

        }

        public Order() { 
        
        }
        
    }

}
